using Game.Main.Model;

namespace Game.Component
{
	public class EyeTestToolItem : BaseItem
	{
		public override void Init(ItemArchiveData data)
		{
			base.Init(data);
		}

		protected override bool ScriptCheckCollsStart()
		{
			for (int i = 0; i < platformColls.Count; i++)
			{
				BaseItem item = platformColls[i].item;
				if (item.itemData.scriptType != 110 || item.itemData.canPlaceTypes == null)
				{
					continue;
				}
				for (int j = 0; j < item.itemData.canPlaceTypes.Length; j++)
				{
					if (item.itemData.canPlaceTypes[j] == base.itemData.placeType)
					{
						((EyeMachineBoxItem)platformColls[i].item).ReleaseEyeTestTool();
						if (item.AttachItem(this, (DepthType)item.itemData.placeSortType, AttachType.PlacePoint, false))
						{
							FreeFall(base.transform.position, item.GetPlacePoint().position);
							return true;
						}
					}
				}
			}
			return false;
		}
	}
}
